package com.kayt.cyberBar.cuser.business.dao.impl;

import java.sql.SQLException;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.kayt.cyberBar.common.dao.EntityDao;
import com.kayt.cyberBar.cuser.business.dao.IPositionTaskResDao;
import com.kayt.cyberBar.cuser.business.entity.po.BPositionTaskRes;

@Repository("positionTaskResDao")
public class PositionTaskResDaoImpl implements IPositionTaskResDao {
	@Autowired
	private EntityDao entityDao;
	
	@Override
	public void saveOrUpdate(BPositionTaskRes entity) throws SQLException {
		if(entity.getId() != null){
			entityDao.update(entity);
		}else{
			entityDao.save(entity);
		}
	}

	public List<BPositionTaskRes> findByHql(Integer firstIndex,Integer maxResult,String hql,Object[] queryParams) throws SQLException{
		return entityDao.getDataByHql(firstIndex, maxResult, hql, queryParams);
	}
}
